import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/footer_button/Home'
import Index from '@/components/footer_button/Index'
import Search from '@/components/footer_button/Search'
import ShopCar from '@/components/footer_button/ShopCar'
import UserInfo from '@/components/footer_button/UserInfo'
import Main from '@/components/common/Main'
import Footer from '@/components/common/Footer'
import Header from '@/components/common/Header'
import HotGoods from '@/components/ninegrid_button/HotGoods'
import SetMeal from '@/components/ninegrid_button/SetMeal'
import Activities from '@/components/ninegrid_button/Activities'
import Idle from '@/components/ninegrid_button/Idle'
import LeaveWordList from '@/components/ninegrid_button/leave_word/LeaveWordList'
import LeaveWordInfo from '@/components/ninegrid_button/leave_word/LeaveWordInfo'
import Feedback from '@/components/ninegrid_button/Feedback'
import Goods from '@/components/ninegrid_button/Goods'

Vue.use(Router)

export default new Router({
  linkActiveClass: 'mui-active',
  routes: [
    {
      path: '/',
      components: {
        default: Main,
        header: Header,
        footer: Footer,
      },
      children: [
        {path: '', redirect: 'index'},
        {path: 'index', name: 'index', component: Index},
        {path: 'search', name: 'search', component: Search},
        {path: 'shopcar', name: 'shopCar', component: ShopCar},
        {path: 'userInfo', name: 'userInfo', component: UserInfo},
        {path: 'home', name: 'home', component: Home},

        {
          path: 'index/hotGoods', component: HotGoods,
          children: [
            {path: '', redirect: 'goods/0'},
            {path: 'goods/:id', component: Goods}
          ]
        },
        {path: 'index/setMeal', name: 'setMeal', component: SetMeal},
        {path: 'index/activities', name: 'activities', component: Activities},
        {path: 'index/idle', name: 'idle', component: Idle},
        {path: 'index/leavewordlist', name: 'leavewordlist', component: LeaveWordList},
        {path: 'index/leavewordinfo/:id', name: 'leavewordinfo', component: LeaveWordInfo},
        {path: 'index/feedback', name: 'feedback', component: Feedback},
      ]
    },
  ]
})
